home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
SecalDemo
/
Projects
/
Tutorials
/
x_AnimDemo.scl
< prev
next >
Wrap
Text File
|
1998-06-24
|
2KB
|
58 lines
/******************************************************************************\
** Anim example (uses the Extension) for Secal **
** Requires Kickstart 2 **
\******************************************************************************/
go main; # EXECUTION STARTS AT THE BEGINNING OF THE
# PROGRAM, GO TO THE MAIN CODE
include "ext/ext.inc"; # COMPILE THE HEADER INTERFACE FOR EXTENSION TOO
inclib "ext/ext.lib"; # USE EXT.LIB AS A LINK LIBRARY
main: # MAIN ENTRY POINT
push d2\a2\a3; # SAVE MODIFIED NONVOLATILE REGISTERS
x_Init; # INITIALIZE EXTENSION
if d0 then
x_GraphicsStart; # START GRAPHICS SUBSYSTEM
if d0 then
x_Ani_Load("data/demo.anim",-1); a2:=a0;
# LOAD AND INIT ANIM, STORE PTR IN A2
if a2 then
x_Scr_Open(x_ani(a2).camg,x_ani(a2).width,x_ani(a2).height,x_ani(a2).depth,0,a1,0);
# OPEN SCREEN, WIDTH, HEIGHT, DEPTH, ETC. TAKEN
# FROM X_ANI STRUCTURE, COLORS (RGB8) ALSO RETURNED
a3:=a0; # STORE PTR IN A3
if a3 then
x_Scr_AddBmp(a3); # ADD ANOTHER BITMAP FOR DOUBLE BUFFERING
if d0 then
x_SetTaskPri(0,31); # RAISE TASK PRI FOR SMOOTH ACTION
d2:=0;
repeat
d2:=d2 xor 1; # IDENTIFIES WORK BUF
x_Scr_GetBmp(a3,d2); # GET WORK BITMAP POINTER
x_Ani_DoFrame(a2,a0,0,0,a3); # RENDER ANIM FRAME
x_Scr_ActivateBmp(a3,d2,-1,-1); # SWITCH SCR BUFFERS, THIS WILL
# ALSO WAIT FOR NEXT FRAME
until [$dff016] and $400=0; # DIRTY CHECK FOR RIGHT MOUSE BUTTON
x_RevertTaskPri; # REVERT TO PREVIOUS PRI
;
;
;
;
x_Done; # SHUT DOWN EXTENSION. THIS FUNCTION WILL ALSO FREE
# EVERYTHING ALLOCATED THRU THE EXTENSION, WHICH WE
# DIDN'T FREE ALLREADY (SCREENS, MUSIC, ANIMS, ETC.)
;
d0.l:=0; # RETURN CODE FOR DOS
pop d2\a2\a3; # RESTORE NONVOLATILE REGISTERS
rts; # RETURN